#include<bits/stdc++.h>
#define int long long
using namespace std;

const int N = 1e5;

int n,maxn,cnt;
int a[N + 5],b[N + 5],sum[N + 5];
bool used[N + 5];

int read(){
	int x = 0,f = 1;
	char c = getchar();
	while(c < '0' || c > '9') {if(c == '-') f = -1;c = getchar();}
	while(c >= '0' && c <= '9') x = x * 10 + c - '0',c = getchar();
	return x * f;
}

signed main(){
	freopen("duel.in","r",stdin);
	freopen("duel.out","w",stdout);
	n = read();
	for(int i = 1;i <= n;i++){
		a[i] = read();
		b[a[i]]++;
		maxn = max(maxn,a[i]);
	}
	
	for(int i = 1;i <= maxn;i++){
		sum[i] = sum[i - 1] + b[i];
	}
	
	cnt = 0;
	
	for(int i = 1;i <= maxn;i++){
		if(!b[i])
			continue;
		else {
			if(b[i] <= sum[i - 1] - cnt){
				cnt += b[i];
			}
			else {
				cnt += (sum[i - 1] - cnt);
			}
		}
	}
	printf("%lld\n",n - cnt);
	return 0;
}
